import sysConfig from "@/config"
import tool from '@/utils/tool'
import { createI18n } from 'vue-i18n'
import el_zh_cn from 'element-plus/dist/locale/zh-cn.mjs'
import el_en from 'element-plus/dist/locale/en.mjs'
import el_zh_tw from 'element-plus/dist/locale/zh-tw.mjs'

// import zh_cn from './lang/zh-cn.js'
import en from './lang/en.js'
const messages = {
	'zh_CN': {
		el: el_zh_cn,
	},
	'en': {
		el: el_en,
		...en
	},
	'zh_TW':{
		el:el_zh_tw
	}
}
const i18n = createI18n({
	locale: tool.data.get("APP_LANG") || sysConfig.LANG,
	fallbackLocale: 'zh_cn',
	globalInjection: true,
	silentTranslationWarn: true,
	missingWarn:false,
	silentFallbackWarn:true,
	fallbackWarn:false,
	messages,
})

export default i18n;

